Robots Inside
Table of Content
Ardupilot SITL with Gazebo simulator#
Objective#
Run Ardupilot (copter) SITL and gazebo simulation
- Gazebo garden
- ardupilot_gazebo (plugin)
- MAVProxy
ardupilot_gazebo#
# Clone ardupilot_gazebo repository
# git subfolder
mkdir ~/git
cd git
# git clone -b <branchname> <remote-repo-url>
git clone https://github.com/ArduPilot/ardupilot_gazebo.git
Install#
sudo apt update
sudo apt install libgz-sim7-dev rapidjson-dev
cd aurdupilot_gazebo
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j4
Run#
terminal1
export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/git/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}
export GZ_SIM_RESOURCE_PATH=$HOME/git/ardupilot_gazebo/models:$HOME/git/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}
# note remove sky tag from sdf
gz sim -v 4 -r iris_runway.sdf
-r: run simulation on start -v 4: verbose mode
SITL#
sim_vehicle#
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console
Manual#
terminal2 - run SITL
./arducopter -S --model JSON \
--speedup 1 \
--defaults copter.parm,gazebo-iris.parm \
-I0
MAVProxy#
mavproxy
mavproxy.py --master tcp:127.0.0.1:5760
# Arm and takeoff
mode guided
arm throttle
takeoff 5

Basic Worlds and models#
| iris_with_ardupilot | iris_with_standoff, liftdrag and ardupilot plugins |
| iris_with_gimbal | iris_with_standoff, gimbal_small_2d, liftdrag and ardupilot plugins |
| gimbal_small_2d | Camera sensor declare on tilt_link |
Note
In my computer the sky flickering so i comments them
<scene>
<ambient>1.0 1.0 1.0</ambient>
<background>0.8 0.8 0.8</background>
<!-- <sky></sky> -->
</scene>
Note
Change model to iris_with_gimbal
<include>
<uri>model://iris_with_gimbal</uri>
<pose degrees="true">0 0 0 0 0 90</pose>
</include>
by default camera topic name generate by sensor location
/world/iris_runway/model/iris_with_gimbal/model/gimbal/link/tilt_link/sensor/camera/image
#
/world/iris_runway/model/iris_with_gimbal/model/gimbal/link/tilt_link/sensor/camera/image